home *** CD-ROM | disk | FTP | other *** search
- * FUNCTION atsay
- *
- * Use HP LJ vertical and horizontal decipoint positioning to place
- * character or numeric output on a page.
- *
- * Requires PUBLIC variables pitch and lpi.
- *
- ***********************************************************************
- FUNCTION atsay
- PARAMETERS mrow, mcol, fieldval, pictval
-
- move_hor = ROUND(720/pitch, 2) && Relative horizontal move value
- hor = 720/pitch * mcol && Horizontal position based on @ SAY value
- ver = LTRIM(STR(720/lpi * mrow, 5, 2)) && Vertical position based on @ SAY value
-
- IF TYPE("pictval") = "C" && "L" if not provided
- fieldval = TRANSFORM(fieldval, pictval) && Transform the number
- no_chars = LEN(fieldval) && Calculate length of field
- ??? CHR(27) + "&a" + LTRIM(STR(hor,5,2)) + "h" + ver + "V"
- *
- * Calculate rightmost character position
- *
- end_hor = hor + (move_hor * no_chars)
- *
- * Calculate leftmost character position allowing 90% of pitch value
- * for each character
- new_pos = end_hor - (move_hor * no_chars * .9)
- FOR char = 1 TO no_chars
- ??? CHR(27) + "&a" + LTRIM(STR(new_pos,5,2)) + "H" +
- SUBSTR(fieldval,char,1)
- new_pos = new_pos + (move_hor * .9) && Calculate next character position
- ENDFOR
- ELSE
- ??? CHR(27) + "&a" + LTRIM(STR(hor,5,2)) + "h" + ver + "V" + fieldval
- ENDIF
- RETURN ""
-